define(function (require, exports, module) {
	//组合框组
	var FrameInput=function(selector){
		this.element=$(selector).get(0);
		this.init();
	}
	FrameInput.prototype.init=function(){
		this.element.style.display="none";
		this.frameName=this.element.name+"Frame";

		this.form=this.getForm();
		this.iframe=this.getIframe();

		document.body.appendChild(this.form);
		
		
		this.div=document.createElement("div")
		this.div.style.position="relative";
		this.div.style.padding="5px";
		this.div.appendChild(this.iframe);
		
		$(this.element).after(this.div);

		this.form.submit();
		document.body.removeChild(this.form)
	}
	FrameInput.prototype.getForm=function(){
		var src=$(this.element).attr("data-src")
		
		this.form=document.createElement("form")
		this.form.action=src
		this.form.target=this.frameName
		this.form.method="post"
		
		this.valueInput=$(this.element).clone().get(0)
		this.valueInput.id="";
		
		
		this.form.appendChild(this.valueInput);
		return this.form;
	}
	FrameInput.prototype.getIframe=function(){
		iframe=document.createElement("iframe");
		iframe.name=this.frameName;
		iframe.id=this.frameName;
		iframe.className="iframe"
		iframe.setAttribute("seamless","seamless")
		iframe.setAttribute("frameborder","0")
		iframe.setAttribute("scrolling","no")
		return iframe;
	}
	
	
	module.exports = FrameInput;
})